package com.sgs.carbon.web.config.captcha;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import java.time.Duration;

/**
 * 验证码配置
 *
 * @see <a href="https://hutool.cn/docs/#/captcha/%E6%A6%82%E8%BF%B0"><b>Hutool Captcha</b></a>
 *
 * @author Dave Liu
 * @date 2021-10-08
 */
@Data
@Validated
@ConfigurationProperties(prefix = "carbon.captcha")
public class CaptchaProperties {

    /**
     * 验证码的过期时间
     */
    @NotNull(message = "验证码的过期时间不为空")
    private Duration timeout;

    /**
     * 验证码的高度
     */
    @NotNull(message = "验证码的高度不能为空")
    private Integer height;

    /**
     * 验证码的宽度
     */
    @NotNull(message = "验证码的宽度不能为空")
    private Integer width;

}